import java.io.*;
public class sum_digits{
    public static void main (String[] args) throws IOException {
        if (args.length <1) throw new RuntimeException ("not enough arguments");
        if (args.length >1) throw new RuntimeException ("too many arguments");
        BufferedReader reader = new BufferedReader (new FileReader ( new File (args[0])));
        String line;
        while ((line = reader.readLine()) != null){
            int sum = 0;
            for (int i = 0;i<line.length();i++){
                sum = sum + Character.getNumericValue(line.charAt(i));
            }
            System.out.println(sum);
        }
    }
}
